package com.yskj.mwk.utils;

import org.springframework.http.HttpStatus;

public class ResultUtils {
    /**
     * 成功时返回
     * @param object为data部分的内容
     * @return
     */
    public static JsonResult success(String msg,Object object) {

        return new JsonResult(ResultMsgEnum.NORMAL_RETURN.getCode(),msg,object);
    }

    /**
     * 失败时返回
     * @param
     * @return
     */
    public  static  JsonResult failure(int code,String msg) {

        return  new JsonResult(code,msg);
    }

    /**
     * 异常时返回
     * @param
     * @return
     */
    public  static  JsonResult Exception(Object code, String msg, HttpStatus status) {

        return  new JsonResult(code,msg,status);
    }
}
